package com.thread.future;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

public class Test1Main {
	public static void main(String[] args) throws InterruptedException, ExecutionException {
		FutureTask<String> future = new FutureTask<String>(new Real1Data("name"));
		ExecutorService exe = Executors.newFixedThreadPool(1);
		exe.submit(future);
		System.out.println("请求完毕!!");
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("获取的数据:" + future.get());
	}
}